package com.ruoyi.device.service.impl;

import java.util.List;

import com.ruoyi.device.vo.AllDeviceInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.mapper.TmdDeviceRecordMapper;
import com.ruoyi.device.domain.TmdDeviceRecord;
import com.ruoyi.device.service.ITmdDeviceRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 使用记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-02
 */
@Service
public class TmdDeviceRecordServiceImpl implements ITmdDeviceRecordService 
{
    @Autowired
    private TmdDeviceRecordMapper tmdDeviceRecordMapper;

    /**
     * 查询使用记录
     * 
     * @param id 使用记录主键
     * @return 使用记录
     */
    @Override
    public TmdDeviceRecord selectTmdDeviceRecordById(Long id)
    {
        return tmdDeviceRecordMapper.selectTmdDeviceRecordById(id);
    }

    @Override
    public List<AllDeviceInfoVo> selectTmdDeviceRecordList(AllDeviceInfoVo allDeviceInfoVo) {
        return tmdDeviceRecordMapper.selectTmdDeviceRecordList(allDeviceInfoVo);
    }

    /**
     * 查询使用记录列表
     * 
     * @param tmdDeviceRecord 使用记录
     * @return 使用记录
     */

    /**
     * 新增使用记录
     * 
     * @param tmdDeviceRecord 使用记录
     * @return 结果
     */
    @Override
    public int insertTmdDeviceRecord(TmdDeviceRecord tmdDeviceRecord)
    {
        return tmdDeviceRecordMapper.insertTmdDeviceRecord(tmdDeviceRecord);
    }

    /**
     * 修改使用记录
     * 
     * @param tmdDeviceRecord 使用记录
     * @return 结果
     */
    @Override
    public int updateTmdDeviceRecord(TmdDeviceRecord tmdDeviceRecord)
    {
        return tmdDeviceRecordMapper.updateTmdDeviceRecord(tmdDeviceRecord);
    }

    /**
     * 批量删除使用记录
     * 
     * @param ids 需要删除的使用记录主键
     * @return 结果
     */
    @Override
    public int deleteTmdDeviceRecordByIds(String ids)
    {
        return tmdDeviceRecordMapper.deleteTmdDeviceRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除使用记录信息
     * 
     * @param id 使用记录主键
     * @return 结果
     */
    @Override
    public int deleteTmdDeviceRecordById(Long id)
    {
        return tmdDeviceRecordMapper.deleteTmdDeviceRecordById(id);
    }

    @Override
    public AllDeviceInfoVo selectAllDeviceInfoVoById(Long id) {
        return tmdDeviceRecordMapper.selectAllDeviceInfoVoById(id);
    }

    @Override
    public void insertUseRecord(AllDeviceInfoVo allDeviceInfoVo) {
        tmdDeviceRecordMapper.insertUseRecord(allDeviceInfoVo);
    }

    @Override
    public List<AllDeviceInfoVo> selectTmdDeviceRecordListByUserId(Long userId) {
        return tmdDeviceRecordMapper.selectTmdDeviceRecordListByUserId(userId);
    }
}
